
#pragma once

#include <vector>
#include <iostream>

#include "Card.h"
#include "Deck.h"
#include "HandEvaluator.h"
#include "Player.h"
#include "Types.h"

namespace RackNetPoker
{
	class Table
	{
	public:

		Table();

		void		Game();

		void		AddPlayer(Player& player);
		bool		CanStart() const;
		bool		IsTurnEnd() const;
		Player*		GetNextPlayer();

	private:

		void		_ResetStates();

		std::vector<Player>			m_playerStates;
		size_t						m_maxPlayers;

		size_t						m_currentPlayer;
		size_t						m_currentDealer;

		Player*						m_lastMaxRaise;
		Player*						m_lastPlayer;

		Money						m_smallBlind;
		Money						m_currentMaxBid;

		CardDeck					m_deck;

		std::vector<Card>			m_communityCards;

		Time						m_currentTime;
	
		HandEvaluator				m_evaluator;

		void						NewBidTurn();
	};

}